home *** CD-ROM | disk | FTP | other *** search
- /* Compile with: cc ht72b.c -o ht72b.cgi */
-
- #include <stdio.h>
-
- #ifndef GNUPLOT
- # define GNUPLOT "/usr/bin/gnuplot"
- #endif
- #ifndef PPMTOGIF
- # define PPMTOGIF "/usr2/local/netpbm/bin/ppmtogif"
- #endif
-
- void main()
- {
- char buf[200];
- FILE *GP;
-
- sprintf(buf,"%s | %s -interlace", GNUPLOT, PPMTOGIF);
- GP = popen(buf,"w");
-
- printf("Content-type: image/gif\n\n");
- fflush(stdout);
-
- /* select the ppm device driver */
- fprintf(GP,"set terminal pbm color\n");
-
- /* render at half the normal size */
- fprintf(GP,"set size 0.5,0.5\n");
-
- /* a very simple gnuplot program */
- fprintf(GP,"plot cos(x)\n");
-
- pclose(GP);
-
- exit(0);
- }
-
-